<ion-view view-title={{moduleTitle}}>
    <ion-nav-buttons side="left">
        <a class="button button-icon ion-arrow-left-c" ng-click="goBack()"></a>
    </ion-nav-buttons>
    <div class="tabs-striped tabs-top">
        <div class="tabs">
            <a ng-if="access.list" ng-class="{'tab-item':true,'active': id }" href="#/{{moduleName}}/list">查看</a>
            <a ng-if="access.add" ng-class="{'tab-item':true,'active': !id }" href="#/{{moduleName}}/0">添加</a>
            <a ng-if="access.stats" ng-class="{'tab-item':true,'active': false }" href="#/{{moduleName}}/stats">统计</a>
        </div>
    </div>
    <ion-content class="padding has-tabs-top">
        <form name="detailForm" novalidate="" ng-submit="submitForm(detailForm)">
            <div class="list">
                <insert-date form="detailForm" dateoption="dateOption"></insert-date>
                <insert-select form="detailForm" option="distributorOption"></insert-select>

                <label class="item item-input">
                    <span class="input-label">当月回款<span style="color:red">*</span>：</span>
                    <input type="text" name="this_month_received_payment" ng-model="detail.this_month_received_payment"
                           required
                           ng-pattern='/^\d{1,8}([\.]\d{0,2})?$/'
                           ng-model-options="{ updateOn: 'default blur', debounce: { default: 500, blur: 0 } }">
                </label>
                <!-- Error Container for Password -->
                <div class="validation-error" ng-class="{'is-dirty':form.password.$dirty}"
                     ng-messages="detailForm.this_month_received_payment.$error" role="alert">
                    <div ng-messages-include="templates/system-templates/detail-errors.html"></div>
                </div>

                <label class="item item-input">
                    <span class="input-label">应收账款<span style="color:red">*</span>：</span>
                    <input type="text" name="accounts_receivable" ng-model="detail.accounts_receivable"
                           required
                           ng-pattern='/^\d{1,8}([\.]\d{0,2})?$/'
                           ng-model-options="{ updateOn: 'default blur', debounce: { default: 500, blur: 0 } }">
                </label>
                <!-- Error Container for Password -->
                <div class="validation-error" ng-class="{'is-dirty':form.password.$dirty}"
                     ng-messages="detailForm.accounts_receivable.$error" role="alert">
                    <div ng-messages-include="templates/system-templates/detail-errors.html"></div>
                </div>



                <label class="item item-input">
                    <span class="input-label">逾期时间<span style="color:red">*</span>：</span>
                    <input type="text" name="payment_overdue" ng-model="detail.payment_overdue"
                           required
                           ng-pattern='/^\d{1,8}([\.]\d{0,2})?$/'
                           ng-model-options="{ updateOn: 'default blur', debounce: { default: 500, blur: 0 } }">
                </label>
                <!-- Error Container for Password -->
                <div class="validation-error" ng-class="{'is-dirty':form.password.$dirty}"
                     ng-messages="detailForm.payment_overdue.$error" role="alert">
                    <div ng-messages-include="templates/system-templates/detail-errors.html"></div>
                </div>

                <label class="item item-input">
                    <span class="input-label">信用占款<span style="color:red">*</span>：</span>
                    <input type="text" name="payment_credit" ng-model="detail.payment_credit"
                           required
                           ng-pattern='/^\d{1,8}([\.]\d{0,2})?$/'
                           ng-model-options="{ updateOn: 'default blur', debounce: { default: 500, blur: 0 } }">
                </label>
                <!-- Error Container for Password -->
                <div class="validation-error" ng-class="{'is-dirty':form.password.$dirty}"
                     ng-messages="detailForm.payment_credit.$error" role="alert">
                    <div ng-messages-include="templates/system-templates/detail-errors.html"></div>
                </div>

                <label class="item item-input">
                    <span class="input-label">篷布到期未返还数量：</span>
                    <input type="text" name="paulin_number" ng-model="detail.paulin_number"
                           ng-pattern='/^\d{1,8}([\.]\d{0,2})?$/'
                           ng-model-options="{ updateOn: 'default blur', debounce: { default: 500, blur: 0 } }">
                </label>
                <!-- Error Container for Password -->
                <div class="validation-error" ng-class="{'is-dirty':form.password.$dirty}"
                     ng-messages="detailForm.paulin_number.$error" role="alert">
                    <div ng-messages-include="templates/system-templates/detail-errors.html"></div>
                </div>





                <label class="item item-input">
                    <span class="input-label">篷布逾期时间：</span>
                    <input type="text" name="paulin_overdue" ng-model="detail.paulin_overdue"
                           ng-maxlength="10"
                           ng-model-options="{ updateOn: 'default blur', debounce: { default: 500, blur: 0 } }">
                </label>
                <!-- Error Container for Password -->
                <div class="validation-error" ng-class="{'is-dirty':form.password.$dirty}"
                     ng-messages="detailForm.paulin_overdue.$error" role="alert">
                    <div ng-messages-include="monthly-report-detail-maxlength-200-errors.html"></div>
                </div>



                <label class="item item-input">
                    <span class="input-label">受损信息：</span>
                    <input type="text" name="damage_info" ng-model="detail.damage_info"
                           ng-maxlength="10"
                           ng-model-options="{ updateOn: 'default blur', debounce: { default: 500, blur: 0 } }">
                </label>
                <!-- Error Container for Password -->
                <div class="validation-error" ng-class="{'is-dirty':form.password.$dirty}"
                     ng-messages="detailForm.damage_info.$error" role="alert">
                    <div ng-messages-include="monthly-report-detail-maxlength-10-errors.html"></div>
                </div>


                <label class="item item-input">
                    <span class="input-label">各经销商应收账款及到期篷布明细及管控措施：</span>
                    <input type="text" name="payment_info" ng-model="detail.payment_info"
                           ng-maxlength="10"
                           ng-model-options="{ updateOn: 'default blur', debounce: { default: 500, blur: 0 } }">
                </label>
                <!-- Error Container for Password -->
                <div class="validation-error" ng-class="{'is-dirty':form.password.$dirty}"
                     ng-messages="detailForm.payment_info.$error" role="alert">
                    <div ng-messages-include="invoice-detail-maxlength-200-errors.html"></div>
                </div>
                <label class="item item-input">
                    <span class="input-label">促销执行情况：</span>
                    <input type="text" name="promotion_info" ng-model="detail.promotion_info"
                           ng-maxlength="10"
                           ng-model-options="{ updateOn: 'default blur', debounce: { default: 500, blur: 0 } }">
                </label>
                <!-- Error Container for Password -->
                <div class="validation-error" ng-class="{'is-dirty':form.password.$dirty}"
                     ng-messages="detailForm.promotion_info.$error" role="alert">
                    <div ng-messages-include="monthly-report-detail-maxlength-200-errors.html"></div>
                </div>
                <label class="item item-input">
                    <span class="input-label">不合格信息通报：</span>
                    <input type="text" name="unqualified_info" ng-model="detail.unqualified_info"
                           ng-maxlength="10"
                           ng-model-options="{ updateOn: 'default blur', debounce: { default: 500, blur: 0 } }">
                </label>
                <!-- Error Container for Password -->
                <div class="validation-error" ng-class="{'is-dirty':form.password.$dirty}"
                     ng-messages="detailForm.unqualified_info.$error" role="alert">
                    <div ng-messages-include="monthly-report-detail-maxlength-200-errors.html"></div>
                </div>
                <label class="item item-input">
                    <span class="input-label">意外/事故信息：</span>
                    <input type="text" name="accident_info" ng-model="detail.accident_info"
                           ng-maxlength="10"
                           ng-model-options="{ updateOn: 'default blur', debounce: { default: 500, blur: 0 } }">
                </label>
                <!-- Error Container for Password -->
                <div class="validation-error" ng-class="{'is-dirty':form.password.$dirty}"
                     ng-messages="detailForm.accident_info.$error" role="alert">
                    <div ng-messages-include="monthly-report-detail-maxlength-200-errors.html"></div>
                </div>
                <label class="item item-input">
                    <span class="input-label">未解决事宜：</span>
                    <input type="text" name="pending_issues" ng-model="detail.pending_issues"
                           ng-maxlength="10"
                           ng-model-options="{ updateOn: 'default blur', debounce: { default: 500, blur: 0 } }">
                </label>
                <!-- Error Container for Password -->
                <div class="validation-error" ng-class="{'is-dirty':form.password.$dirty}"
                     ng-messages="detailForm.pending_issues.$error" role="alert">
                    <div ng-messages-include="monthly-report-detail-maxlength-200-errors.html"></div>
                </div>
                <label class="item item-input">
                    <span class="input-label">竞争者信息：</span>
                    <input type="text" name="competitor_info" ng-model="detail.competitor_info"
                           ng-maxlength="10"
                           ng-model-options="{ updateOn: 'default blur', debounce: { default: 500, blur: 0 } }">
                </label>
                <!-- Error Container for Password -->
                <div class="validation-error" ng-class="{'is-dirty':form.password.$dirty}"
                     ng-messages="detailForm.competitor_info.$error" role="alert">
                    <div ng-messages-include="monthly-report-detail-maxlength-200-errors.html"></div>
                </div>
                <label class="item item-input">
                    <span class="input-label">下个月任务：</span>
                    <input type="text" name="next_month_task" ng-model="detail.next_month_task"
                           ng-maxlength="10"
                           ng-model-options="{ updateOn: 'default blur', debounce: { default: 500, blur: 0 } }">
                </label>
                <!-- Error Container for Password -->
                <div class="validation-error" ng-class="{'is-dirty':form.password.$dirty}"
                     ng-messages="detailForm.next_month_task.$error" role="alert">
                    <div ng-messages-include="monthly-report-detail-maxlength-200-errors.html"></div>
                </div>
                

            </div>
            <button class="button button-full button-positive" ng-disabled="detailForm.$invalid || detailEdit.editDisabled" type="submit">
                {{operation}}
            </button>
        </form>
    </ion-content>

    <script id="monthly-report-detail-maxlength-200-errors.html" type="text/ng-template">
        <div class="error" ng-message="maxlength">
            <i class="ion-information-circled"></i> 字符长度不能超过200个
        </div>
    </script>
    <script id="monthly-report-detail-maxlength-10-errors.html" type="text/ng-template">
        <div class="error" ng-message="maxlength">
            <i class="ion-information-circled"></i> 字符长度不能超过10个
        </div>
    </script>
    <!--头部和内容结束-->
</ion-view>